<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>新增</title>
</head>
<body>
    <header><a href="javascript:history.back()">返回</a><h2 th:text="(${book!=null}) ? '编辑' : '添加'">添加新书</h2></header>
    <form method="post" action="/books/add">
        <input type="hidden" name="id" th:value="(${book!=null}) ? ${book.id} : ''">
        <input type="hidden" name="creatoruid" th:value="(${book!=null}) ? ${book.creatoruid} : ''">
        <label>书名：</label><input name="name" th:value="(${book!=null}) ? ${book.name} : ''"></br>
        <label>作者：</label><input name="author" th:value="(${book!=null}) ? ${book.author} : ''"></br>
        <label>ISBN：</label><input name="isbn" th:value="(${book!=null}) ? ${book.isbn} : ''"></br>
        <label>出版社：</label><input name="publisher" th:value="(${book!=null}) ? ${book.publisher} : ''"></br>
        <label>出版日期：</label><input name="publicationDate" th:value="(${book!=null}) ? ${book.publicationDate} : ''"></br>
        <label>简介：</label><input name="description" th:value="(${book!=null}) ? ${book.description} : ''"></br>
        <label>评价：</label><input name="comment" th:value="(${book!=null}) ? ${book.comment} : ''"></br>
        <label>网址：</label><input name="saleUrl" th:value="(${book!=null}) ? ${book.saleUrl} : ''"></br>
        <label>分享：</label><select name="isShare">
            <option value="null" ></option>
            <option value="true" th:selected="${book!=null and book.isShare==true}">是</option>
            <option value="false" th:selected="${book!=null and book.isShare==false}">否</option>
        </select></br>
        <input type="submit" value="提交"/>
        <input type="reset" value="重置"/>
    </form>
</body>
</html>